package com.atguigu.springcloud.controller;

import com.atguigu.springcloud.entities.CommonResult;
import com.atguigu.springcloud.service.AccountService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Author: robert.song
 * @Date: Created in 2021/12/16
 */
@RestController
@RequestMapping("/account")
public class AccountController {
    @Resource
    AccountService accountService;
    @RequestMapping("/decrease")
    public CommonResult decrease(@RequestParam("userId") Long userId,@RequestParam("money") Double money){
        accountService.decrease(userId,money);
        return new CommonResult(200,"扣减余额成功");
    }
}
